package edu.chds.utils
{
	public class GlobalFunction
	{
		public static function RemoveDuplicateArray(array:Array):Array {
			var originalArray:Array = array;
			var dedupedArray:Array = new Array();

			for each (var colour:String in originalArray){
				var tempValue:String = colour;
				if(dedupedArray.some(hasDupes)==false){
					dedupedArray.push(tempValue);
				}
			}
			function hasDupes(element:String, index:int, array:Array):Boolean {
				return (element == tempValue);
			}
//			trace("dedupedArray: "+dedupedArray);
			return dedupedArray;
		}
	}
}